﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using MySql.Data.MySqlClient;

namespace Framework_Tool
{
    /// <summary>
    /// Interaction logic for StaffLogin.xaml
    /// </summary>
    public partial class StaffLogin : Page
    {
        MainWindow main;

        public StaffLogin(MainWindow main)
        {
            InitializeComponent();
            this.main = main;
            stfUsernameTxt.Focus();
        }

        private void stfLogin_Click(object sender, RoutedEventArgs e)
        {
            main.userLbl.Content = Database.Login(stfUsernameTxt.Text, stfPasswordTxt.Password, main);
        }

        private void stfPicLogin_Click_1(object sender, RoutedEventArgs e)
        {
            LearnerLogin lrnerLoginWindow = new LearnerLogin(main);
            lrnerLoginWindow.Content = null;
            mainContent.Children.Add(lrnerLoginWindow.mainContent);
        }   

        private void staffLoginPageBtn_Click_1(object sender, RoutedEventArgs e)
        {
            StaffLogin stfLoginWindow = new StaffLogin(main);
            stfLoginWindow.Content = null;
            mainContent.Children.Add(stfLoginWindow.mainContent);
        }

        private void stdtPicBtn_Click_1(object sender, RoutedEventArgs e)
        {
            LearnerLogin stdtLoginWindow = new LearnerLogin(main);
            stdtLoginWindow.Content = null;
            mainContent.Children.Add(stdtLoginWindow.mainContent);
        }

        private void stdtLoginPageBtn_Click_1(object sender, RoutedEventArgs e)
        {
            LearnerLogin stdtLoginWindow = new LearnerLogin(main);
            stdtLoginWindow.Content = null;
            mainContent.Children.Add(stdtLoginWindow.mainContent);
        }

        private void stfPicBtn_Click_1(object sender, RoutedEventArgs e)
        {
            StaffLogin stfLoginWindow = new StaffLogin(main);
            stfLoginWindow.Content = null;
            mainContent.Children.Add(stfLoginWindow.mainContent);
        }

        private void studentLogin_Click_1(object sender, RoutedEventArgs e)
        {
            LearnerLogin stdtLoginWindow = new LearnerLogin(main);
            stdtLoginWindow.Content = null;
            mainContent.Children.Add(stdtLoginWindow.mainContent);
        }
    }
}
